package com.wqzhang.thingswapper.dao.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.wqzhang.thingswapper.dao.greendao.User;
import com.wqzhang.thingswapper.dao.greendao.ToDoThing;
import com.wqzhang.thingswapper.dao.greendao.Notification;
import com.wqzhang.thingswapper.dao.greendao.Connection_T_N;

import com.wqzhang.thingswapper.dao.greendao.UserDao;
import com.wqzhang.thingswapper.dao.greendao.ToDoThingDao;
import com.wqzhang.thingswapper.dao.greendao.NotificationDao;
import com.wqzhang.thingswapper.dao.greendao.Connection_T_NDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig userDaoConfig;
    private final DaoConfig toDoThingDaoConfig;
    private final DaoConfig notificationDaoConfig;
    private final DaoConfig connection_T_NDaoConfig;

    private final UserDao userDao;
    private final ToDoThingDao toDoThingDao;
    private final NotificationDao notificationDao;
    private final Connection_T_NDao connection_T_NDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        toDoThingDaoConfig = daoConfigMap.get(ToDoThingDao.class).clone();
        toDoThingDaoConfig.initIdentityScope(type);

        notificationDaoConfig = daoConfigMap.get(NotificationDao.class).clone();
        notificationDaoConfig.initIdentityScope(type);

        connection_T_NDaoConfig = daoConfigMap.get(Connection_T_NDao.class).clone();
        connection_T_NDaoConfig.initIdentityScope(type);

        userDao = new UserDao(userDaoConfig, this);
        toDoThingDao = new ToDoThingDao(toDoThingDaoConfig, this);
        notificationDao = new NotificationDao(notificationDaoConfig, this);
        connection_T_NDao = new Connection_T_NDao(connection_T_NDaoConfig, this);

        registerDao(User.class, userDao);
        registerDao(ToDoThing.class, toDoThingDao);
        registerDao(Notification.class, notificationDao);
        registerDao(Connection_T_N.class, connection_T_NDao);
    }
    
    public void clear() {
        userDaoConfig.clearIdentityScope();
        toDoThingDaoConfig.clearIdentityScope();
        notificationDaoConfig.clearIdentityScope();
        connection_T_NDaoConfig.clearIdentityScope();
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public ToDoThingDao getToDoThingDao() {
        return toDoThingDao;
    }

    public NotificationDao getNotificationDao() {
        return notificationDao;
    }

    public Connection_T_NDao getConnection_T_NDao() {
        return connection_T_NDao;
    }

}
